var do_Page = sm("do_Page");
var root = ui("$");
var tabCircleText = ui("tabCircleText");
var tabCircleBg = ui("tabCircleBg");
var tabNeighboursText = ui("tabNeighboursText");
var tabNeighboursBg = ui("tabNeighboursBg");
var menuNeighbours = ui("menuNeighbours");
// 设置数据绑定的映射关系
root.setMapping({ // 此处的Mapping只能设置在 RootView 上 ;
	"menuNeighbours.tag" : "communityMessageTags",
	"menuNeighbours.visible" : "isCommunityMessage"
});
var tagsData = mm("do_ListData");
var isLoadTags=false;
root.on("dataRefreshed", function(){
	if(!isLoadTags){
		/*tag推荐*/
		tagsData.removeAll();
		var dataTag = JSON.parse(menuNeighbours.tag);
		menuNeighbours.bindItems(tagsData);
		tagsData.addData(dataTag);
		menuNeighbours.refreshItems();
		isLoadTags=true;
	}
	tabStyle(!menuNeighbours.visible);
});
//点击邻里动态
ui("tabCircle").on("touch",'',1000,function(data){
	tabStyle(true);
	do_Page.fire("community_newIndex_tab",{tabType:"circle"});
})
//点击邻里动态
ui("tabNeighbours").on("touch",'',1000,function(data){
	tabStyle(false);
	do_Page.fire("community_newIndex_tab",{tabType:"communityMessage"});
})
function tabStyle(flag){
	if(flag){
		tabCircleText.fontColor="ff5305FF";
		tabNeighboursText.fontColor="949EAAFF";
		tabCircleBg.bgColor="ff5305FF";
		tabNeighboursBg.bgColor = "00000000";
	}
	else{
		tabCircleText.fontColor="949EAAFF";
		tabNeighboursText.fontColor="ff5305FF";
		tabCircleBg.bgColor="00000000";
		tabNeighboursBg.bgColor = "ff5305FF";
	}
}